<?php session_start();
if(isset($_SESSION['user_id'])):
	$user_id=$_SESSION['user_id'];
	$user_email=$_SESSION['user_email'];
	$nickname=$_SESSION['nickname'];
endif;
require_once("php/curl.php");
$stats = json_decode(api("stats/","GET",null),true);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>spork!</title>
<script type="text/javascript" src="scripts/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="scripts/api.js"></script>
<script type="text/javascript" src="scripts/scripts.js"></script>
<link href="style/main.css" rel="stylesheet" type="text/css" />

<script>
	$(document).ready(function(){
		size_labels();						   
	});
	
	function next_step(){
		$("#step-1").hide();
		$("#step-2").show().children("input:first").focus();
	}
</script>
<style>
	input[name=pfq], input[name=pfa]{
		width: 100%;
	}
	
	#center img, #center form{
		vertical-align: top !important;	
	}
	
	#step-2{
		display: none;	
	}
</style>
</head>

<body>
<div id="container">
<?php include("nav.php");?>
	<div id="center">
        <div id="login-signup">
            <img src="images/logo/250x250/logo-red.png" class="spork" align="middle" alt="spork!" title="spork!" />
            <form id="signup">
            	<h4>Already have an account?</h4>
            	<input class="attention" type="button" onClick="window.location='index.php'" value="Login Now" />
                <div class="callback_msg"></div>
                <span id="step-1">
                    <label for="email" class="required">Email:</label>
                    <input type="text" name="email" value="<?php echo $_POST['email'];?>"><br />
                    <label for="password" class="required">Password:</label>
                    <input type="password" name="password" value="<?php echo $_POST['password'];?>"><br />
                    <label for="nickname" class="required">Nickname:</label>
                    <input type="text" name="nickname"><br />
                    <label for="fname">First name:</label>
                    <input type="text" name="fname"><br />
                    <label for="lname">Last name:</label>
                    <input type="text" name="lname"><br />
                    <input type="button" value="One more step..." onClick="next_step()" />
                </span><!--step 1-->
                <span id="step-2">
                    <label for="pfq" class="required ignore">Forgot Password Question:</label><br />
                    <input type="text" name="pfq" />
                   <!--<select name="pfq">
                    <?php /*include("php/password-forgot-questions.php");
                    foreach($questions as $q):
                        echo "<option value=\"$q\">$q</option>";
                    endforeach;*/
                    ?>
                    </select>-->
                    <br />
                    <label for="pfa" class="required ignore">Forgot Password Answer:</label><br />
                    <input type="text" name="pfa"><br />
                    <input type="button" value="Finished!" onClick="signup()" />
                </span><!--step 2-->
            </form>
    	</div><!--login or signup-->
	</div><!--center-->
</div><!--container-->

<script>
$("form input:not([type=button]):first").focus();
random_logo("img.spork:first");
</script>

</body>
</html>